home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / larn.lha / data.c < prev    next >
C/C++ Source or Header  |  1995-11-19  |  31KB  |  587 lines

  1. #include "header.h"
  2. #include "monsters.h"
  3. #include "objects.h"
  4.  
  5. #define VER    12
  6. #define SUBVER  3
  7.  
  8. /*
  9.     class[c[LEVEL]-1] gives the correct name of the players experience level
  10. */
  11. static char aa1[] = " mighty evil master";
  12. static char aa2[] = "apprentice demi-god";
  13. static char aa3[] = "  minor demi-god   ";
  14. static char aa4[] = "  major demi-god   ";
  15. static char aa5[] = "    minor deity    ";
  16. static char aa6[] = "    major deity    ";
  17. static char aa7[] = "  novice guardian  ";
  18. static char aa8[] = "apprentice guardian";
  19. static char aa9[] = "    The Creator    ";
  20. char *class[]=
  21. {   "  novice explorer  ", "apprentice explorer", " practiced explorer",/*  -3*/
  22.     "   expert explorer ", "  novice adventurer", "     adventurer    ",/*  -6*/
  23.     "apprentice conjurer", "     conjurer      ", "  master conjurer  ",/*  -9*/
  24.     "  apprentice mage  ", "        mage       ", "  experienced mage ",/* -12*/
  25.     "     master mage   ", " apprentice warlord", "   novice warlord  ",/* -15*/
  26.     "   expert warlord  ", "   master warlord  ", " apprentice gorgon ",/* -18*/
  27.     "       gorgon      ", "  practiced gorgon ", "   master gorgon   ",/* -21*/
  28.     "    demi-gorgon    ", "    evil master    ", " great evil master ",/* -24*/
  29.       aa1       ,   aa1       ,   aa1       ,/* -27*/
  30.       aa1       ,   aa1       ,   aa1       ,/* -30*/
  31.       aa1       ,   aa1       ,   aa1       ,/* -33*/
  32.       aa1       ,   aa1       ,   aa1       ,/* -36*/
  33.       aa1       ,   aa1       ,   aa1       ,/* -39*/
  34.       aa2       ,   aa2       ,   aa2       ,/* -42*/
  35.       aa2       ,   aa2       ,   aa2       ,/* -45*/
  36.       aa2       ,   aa2       ,   aa2       ,/* -48*/
  37.       aa3       ,   aa3       ,   aa3       ,/* -51*/
  38.       aa3       ,   aa3       ,   aa3       ,/* -54*/
  39.       aa3       ,   aa3       ,   aa3       ,/* -57*/
  40.       aa4       ,   aa4       ,   aa4       ,/* -60*/
  41.       aa4       ,   aa4       ,   aa4       ,/* -63*/
  42.       aa4       ,   aa4       ,   aa4       ,/* -66*/
  43.       aa5       ,   aa5       ,   aa5       ,/* -69*/
  44.       aa5       ,   aa5       ,   aa5       ,/* -72*/
  45.       aa5       ,   aa5       ,   aa5       ,/* -75*/
  46.       aa6       ,   aa6       ,   aa6       ,/* -78*/
  47.       aa6       ,   aa6       ,   aa6       ,/* -81*/
  48.       aa6       ,   aa6       ,   aa6       ,/* -84*/
  49.       aa7       ,   aa7       ,   aa7       ,/* -87*/
  50.       aa8       ,   aa8       ,   aa8       ,/* -90*/
  51.       aa8       ,   aa8       ,   aa8       ,/* -93*/
  52.     "  earth guardian   ", "   air guardian    ", "   fire guardian   ",/* -96*/
  53.     "  water guardian   ", "  time guardian    ", " ethereal guardian ",/* -99*/
  54.       aa9       ,   aa9       ,   aa9       ,/* -102*/
  55. };
  56.  
  57. /*
  58.     table of experience needed to be a certain level of player
  59.     skill[c[LEVEL]] is the experience required to attain the next level
  60.  */
  61. #define MEG 1000000
  62. long skill[] = {
  63. 0, 10, 20, 40, 80, 160, 320, 640, 1280, 2560, 5120,                  /*  1-11 */
  64. 10240, 20480, 40960, 100000, 200000, 400000, 700000, 1*MEG,          /* 12-19 */
  65. 2*MEG,3*MEG,4*MEG,5*MEG,6*MEG,8*MEG,10*MEG,                          /* 20-26 */
  66. 12*MEG,14*MEG,16*MEG,18*MEG,20*MEG,22*MEG,24*MEG,26*MEG,28*MEG,      /* 27-35 */
  67. 30*MEG,32*MEG,34*MEG,36*MEG,38*MEG,40*MEG,42*MEG,44*MEG,46*MEG,      /* 36-44 */
  68. 48*MEG,50*MEG,52*MEG,54*MEG,56*MEG,58*MEG,60*MEG,62*MEG,64*MEG,      /* 45-53 */
  69. 66*MEG,68*MEG,70*MEG,72*MEG,74*MEG,76*MEG,78*MEG,80*MEG,82*MEG,      /* 54-62 */
  70. 84*MEG,86*MEG,88*MEG,90*MEG,92*MEG,94*MEG,96*MEG,98*MEG,100*MEG,     /* 63-71 */
  71. 105*MEG,110*MEG,115*MEG,120*MEG, 125*MEG, 130*MEG, 135*MEG, 140*MEG, /* 72-79 */
  72. 145*MEG,150*MEG,155*MEG,160*MEG, 165*MEG, 170*MEG, 175*MEG, 180*MEG, /* 80-87 */
  73. 185*MEG,190*MEG,195*MEG,200*MEG, 210*MEG, 220*MEG, 230*MEG, 240*MEG, /* 88-95 */
  74. 250*MEG,260*MEG,270*MEG,280*MEG, 290*MEG, 300*MEG                    /* 96-101*/
  75. };
  76. #undef MEG
  77.  
  78. char *lpbuf,*lpnt,*inbuffer,*lpend; /* input/output pointers to the buffers */
  79. # ifdef MSDOS
  80. RAMBLOCK *ramblks;
  81. DISKBLOCK *diskblks;
  82. # else
  83. struct cel *cell;   /*  pointer to the dungeon storage  */
  84. # endif
  85. short hitp[MAXX][MAXY];     /*  monster hp on level     */
  86. short iarg[MAXX][MAXY]; /*  arg for the item array  */
  87. char item[MAXX][MAXY];  /*  objects in maze if any  */
  88. char know[MAXX][MAXY];  /*  1 or 0 if here before   */
  89. char mitem[MAXX][MAXY]; /*  monster item array      */
  90. char stealth[MAXX][MAXY];   /*  0=sleeping 1=awake monst*/
  91. char lastmonst[40];     /*  this has the name of the current monster    */
  92. char beenhere[MAXLEVEL+MAXVLEVEL];  /*  1 if have been on this level */
  93. char VERSION=VER;   /*  this is the present version # of the program    */
  94. char SUBVERSION=SUBVER;
  95. char nosignal=0;    /* set to 1 to disable the signals from doing anything */
  96. char predostuff=0;  /*  2 means that the trap handling routines must do a
  97.                         showplayer() after a trap.  0 means don't showplayer()
  98.                         0 - we are in create player screen
  99.                         1 - we are in welcome screen
  100.                         2 - we are in the normal game   */
  101. char loginname[20];     /* players login name */
  102. char logname[LOGNAMESIZE];  /* players name storage for scoring             */
  103. char sex=1;             /*  default is a man  0=woman                       */
  104. char boldon=1;          /*  1=bold objects  0=inverse objects               */
  105. char ckpflag=0;         /*  1 if want checkpointing of game, 0 otherwise    */
  106. char cheat=0;           /*  1 if the player has fudged save file            */
  107. char level=0;           /*  cavelevel player is on = c[CAVELEVEL]           */
  108. char wizard=0;          /*  the wizard mode flag                            */
  109. short lastnum=0;        /* the number of the monster last hitting player    */
  110. short hitflag=0;        /*  flag for if player has been hit when running    */
  111. short hit2flag=0;       /*  flag for if player has been hit when running    */
  112. short hit3flag=0;       /*  flag for if player has been hit flush input     */
  113. short playerx,playery;  /*  the room on the present level of the player     */
  114. short lastpx,lastpy;    /*  0 --- MAXX-1  or  0 --- MAXY-1                  */
  115. short oldx,oldy;
  116. char  prayed = 1;       /* did player pray at an altar (command mode)? needs
  117.                            to be saved, but I don't want to add incompatibility
  118.                            right now.  KBR 1/11/90 */
  119. short lasthx=0,lasthy=0;/* location of monster last hit by player       */
  120. short nobeep=0;         /* true if program is not to beep                   */
  121. unsigned long lrandx=33601;  /*  the random number seed                      */
  122. long initialtime=0;         /* time playing began                           */
  123. long gtime=0;               /*  the clock for the game                      */
  124. long outstanding_taxes=0;   /* present tax bill from score file             */
  125. long c[100],cbak[100];      /*  the character description arrays            */
  126. int enable_scroll=0;        /* constant for enabled/disabled scrolling regn */
  127. char aborted[] = " aborted";
  128. struct sphere *spheres=0; /*pointer to linked list for spheres of annihilation*/
  129. char *levelname[]=
  130. { " H"," 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9","10","V1","V2","V3" };
  131.  
  132. char original_objnamelist[]=".AT_P<_F&^+M=>_$$f*OD#~][[)))(((||||||||{?!BC}o:;,@@@@EVV))([[]]](^.[H***.^^.S.tsTLc_____________________________________________";
  133. char hacklike_objnamelist[]=".:\\_^<_{%^6|2>_55}$'+#~[[[))))))========-?!?&~~~~~****899)))[[[[[)^.[1$$$.^^.3./0\\4,____________________________________________";
  134. char objnamelist[MAXOBJECT+1];
  135. char monstnamelist[]=".BGHJKOScjtAELNQRZabhiCTYdegmvzFWflorXV.pqsyUkMwDDPxnDDuD........,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,";
  136. char floorc = '.';
  137. char wallc  = '#';
  138. char boldobjects = FALSE ;
  139. char auto_pickup = FALSE ;
  140.  
  141. # ifdef MSDOS
  142.   int DECRainbow, keypad;
  143. # endif
  144.  
  145. char *objectname[]=
  146. { 0,"a holy altar","a handsome jewel encrusted throne","the orb","a pit",
  147.   "a staircase leading upwards","an elevator going up","a bubbling fountain",
  148.   "a great marble statue","a teleport trap","the college of Larn",
  149.   "a mirror","the DND store","a staircase going down","an elevator going down",
  150.   "the bank of Larn","the 5th branch of the Bank of Larn",
  151.   "a dead fountain","gold","an open door","a closed door",
  152.   "a wall","The Eye of Larn","plate mail","chain mail","leather armor",
  153.   "a sword of slashing","Bessman's flailing hammer","a sunsword",
  154.   "a two handed sword","a spear","a dagger",
  155.   "ring of extra regeneration","a ring of regeneration","a ring of protection",
  156.   "an energy ring","a ring of dexterity","a ring of strength",
  157.   "a ring of cleverness","a ring of increase damage","a belt of striking",
  158.   "a magic scroll","a magic potion","a book","a chest",
  159.   "an amulet of invisibility","an orb of dragon slaying",
  160.   "a scarab of negate spirit","a cube of undead control",
  161.   "device of theft prevention","a brilliant diamond","a ruby",
  162.   "an enchanting emerald","a sparkling sapphire","the dungeon entrance",
  163.   "a volcanic shaft leaning downward","the base of a volcanic shaft",
  164.   "a battle axe","a longsword","a flail","ring mail","studded leather armor",
  165.   "splint mail","plate armor","stainless plate armor","a lance of death",
  166.   "an arrow trap","an arrow trap","a shield","your home",
  167.   "gold","gold","gold","a dart trap",
  168.   "a dart trap","a trapdoor","a trapdoor","the local trading post",
  169.   "a teleport trap", "a massive throne",
  170.   "a sphere of annihilation","a handsome jewel encrusted throne",
  171.   "the Larn Revenue Service","a fortune cookie","","","","","","",
  172.   "","","","","","","","","","","","","","","","","","","",""
  173.  };
  174.  
  175.  
  176. /*
  177.  *  for the monster data
  178.  *
  179.  *  array to do rnd() to create monsters <= a given level
  180.  */
  181. char monstlevel[] = { 5, 11, 17, 22, 27, 33, 39, 42, 46, 50, 53, 56, 59 };
  182.  
  183. struct monst monster[] = {
  184. /*  NAME            LV  AC  DAM ATT DEF GEN INT GOLD    HP  EXP
  185. ----------------------------------------------------------------- */
  186. { "",               0,  0,  0,  0,  0,   0,  3,   0,    0,  0   },
  187. { "bat",            1,  0,  1,  0,  0,   0,  3,   0,    1,  1   },
  188. { "gnome",          1,  10, 1,  0,  0,   0,  8,  30,    2,  2   },
  189. { "hobgoblin",      1,  14, 2,  0,  0,   0,  5,  25,    3,  2   },
  190. { "jackal",         1,  17, 1,  0,  0,   0,  4,   0,    1,  1   },
  191. { "kobold",         1,  20, 1,  0,  0,   0,  7,  10,    1,  1   },
  192.  
  193. { "orc",            2,  12, 1,  0,  0,   0,  9,  40,    4,  2   },
  194. { "snake",          2,  15, 1,  0,  0,   0,  3,   0,    3,  1   },
  195. { "giant centipede",2,  14, 0,  4,  0,   0,  3,   0,    1,  2   },
  196. { "jaculi",         2,  20, 1,  0,  0,   0,  3,   0,    2,  1   },
  197. { "troglodyte",     2,  10, 2,  0,  0,   0,  5,  80,    4,  3   },
  198. { "giant ant",      2,  8,  1,  4,  0,   0,  4,   0,    5,  5   },
  199.  
  200. /*  NAME            LV  AC  DAM ATT DEF GEN INT GOLD    HP  EXP
  201. ----------------------------------------------------------------- */
  202.  
  203. { "floating eye",   3,  8,  1,  0,  0,   0,  3,   0,     5,  2  },
  204. { "leprechaun",     3,  3,  0,  8,  0,   0,  3,1500,    13, 45  },
  205. { "nymph",          3,  3,  0,  14, 0,   0,  9,   0,    18, 45  },
  206. { "quasit",         3,  5,  3,  0,  0,   0,  3,   0,    10, 15  },
  207. { "rust monster",   3,  4,  0,  1,  0,   0,  3,   0,    18, 25  },
  208. { "zombie",         3,  12, 2,  0,  0,   0,  3,   0,     6,  7  },
  209.  
  210. { "assassin bug",   4,  9,  3,  0,  0,   0,  3,   0,    20, 15  },
  211. { "bugbear",        4,  5,  4,  15, 0,   0,  5,  40,    20, 35  },
  212. { "hell hound",     4,  5,  2,  2,  0,   0,  6,   0,    16, 35  },
  213. { "ice lizard",     4,  11, 2,  10, 0,   0,  6,  50,    16, 25  },
  214. { "centaur",        4,  6,  4,  0,  0,   0, 10,  40,    24, 45  },
  215.  
  216. /*  NAME            LV  AC  DAM ATT DEF GEN INT GOLD    HP  EXP
  217. ----------------------------------------------------------------- */
  218.  
  219. { "troll",          5,  4,  5,  0,  0,   0,  9,  80,    50, 300 },
  220. { "yeti",           5,  6,  4,  0,  0,   0,  5,  50,    35, 100 },
  221. { "white dragon",   5,  2,  4,  5,  0,   0, 16, 500,    55, 1000},
  222. { "elf",            5,  8,  1,  0,  0,   0, 15,  50,    22, 35  },
  223. { "gelatinous cube",5,  9,  1,  0,  0,   0,  3,   0,    22, 45  },
  224.  
  225. { "metamorph",      6,  7,  3,  0,  0,   0,  3,  0,     30, 40  },
  226. { "vortex",         6,  4,  3,  0,  0,   0,  3,  0,     30, 55  },
  227. { "ziller",         6,  15, 3,  0,  0,   0,  3,  0,     30, 35  },
  228. { "violet fungi",   6,  12, 3,  0,  0,   0,  3,  0,     38, 100 },
  229. { "wraith",         6,  3,  1,  6,  0,   0,  3,  0,     30, 325 },
  230. { "forvalaka",      6,  2,  5,  0,  0,   0,  7,  0,     50, 280 },
  231.  
  232. /*  NAME            LV  AC  DAM ATT DEF GEN INT GOLD    HP  EXP
  233. ----------------------------------------------------------------- */
  234.  
  235. { "lama nobe",      7,  7,  3,  0,  0,   0,  6,  0,     35, 80  },
  236. { "osequip",        7,  4,  3,  16, 0,   0,  4,  0,     35, 100 },
  237. { "rothe",          7,  15, 5,  0,  0,   0,  3,  100,   50, 250 },
  238. { "xorn",           7,  0,  6,  0,  0,   0, 13,  0,     60, 300 },
  239. { "vampire",        7,  3,  4,  6,  0,   0, 17,  0,     50, 1000},
  240. { "invisible stalker",7,3,  6,  0,  0,   0,  5,  0,     50, 350 },
  241.  
  242. { "poltergeist",    8,  1,  4,  0,  0,   0,  3,  0,     50, 450 },
  243. { "disenchantress", 8,  3,  0,  9,  0,   0,  3,  0,     50, 500 },
  244. { "shambling mound",8,  2,  5,  0,  0,   0,  6,  0,     45, 400 },
  245. { "yellow mold",    8,  12, 4,  0,  0,   0,  3,  0,     35, 250 },
  246. { "umber hulk",     8,  3,  7,  11, 0,   0, 14,  0,     65, 600 },
  247.  
  248. /*  NAME            LV  AC  DAM ATT DEF GEN INT GOLD    HP  EXP
  249. ----------------------------------------------------------------- */
  250.  
  251. { "gnome king",     9,  -1, 10, 0,  0,   0, 18,  2000,  100,3000    },
  252. { "mimic",          9,   5, 6,  0,  0,   0,  8,  0,     55, 99      },
  253. { "water lord",     9, -10, 15, 7,  0,   0, 20,  0,     150,15000   },
  254. { "bronze dragon",  9,   2, 9,  3,  0,   0, 16,  300,   80, 4000    },
  255. { "green dragon",   9,   3, 8,  10, 0,   0, 15,  200,   70, 2500    },
  256. { "purple worm",    9,  -1, 11, 0,  0,   0,  3,  100,   120,15000   },
  257. { "xvart",          9,  -2, 12, 0,  0,   0, 13,  0,     90, 1000    },
  258.  
  259. { "spirit naga",    10, -20,12, 12, 0,   0, 23,  0,     95, 20000   },
  260. { "silver dragon",  10, -1, 12, 3,  0,   0, 20,  700,   100,10000   },
  261. { "platinum dragon",10, -5, 15, 13, 0,   0, 22,  1000,  130,24000   },
  262. { "green urchin",   10, -3, 12, 0,  0,   0,  3,  0,     85, 5000    },
  263. { "red dragon",     10, -2, 13, 3,  0,   0, 19,  800,   110,14000   },
  264.  
  265. { "type I demon lord",  12,-30, 18, 0,   0,  0, 20, 0,  140,50000   },
  266. { "type II demon lord", 13,-30, 18, 0,   0,  0, 21, 0,  160,75000   },
  267. { "type III demon lord",14,-30, 18, 0,   0,  0, 22, 0,  180,100000  },
  268. { "type IV demon lord", 15,-35, 20, 0,   0,  0, 23, 0,  200,125000  },
  269. { "type V demon lord",  16,-40, 22, 0,   0,  0, 24, 0,  220,150000  },
  270. { "type VI demon lord", 17,-45, 24, 0,   0,  0, 25, 0,  240,175000  },
  271. { "type VII demon lord",18,-70, 27, 6,   0,  0, 26, 0,  260,200000  },
  272. { "demon prince",       25,-127,30, 6,   0,  0, 28, 0,  345,300000  }
  273.  
  274. /*  NAME                LV  AC  DAM ATT DEF GEN INT GOLD    HP  EXP
  275. --------------------------------------------------------------------- */
  276.  };
  277.  
  278. /*  name array for scrolls      */
  279.  
  280. char *scrollname[MAXSCROLL+1] = {
  281. "\0enchant armor",
  282. "\0enchant weapon",
  283. "\0enlightenment",
  284. "\0blank paper",
  285. "\0create monster",
  286. "\0create artifact",
  287. "\0aggravate monsters",
  288. "\0time warp",
  289. "\0teleportation",
  290. "\0expanded awareness",
  291. "\0haste monsters",
  292. "\0monster healing",
  293. "\0spirit protection",
  294. "\0undead protection",
  295. "\0stealth",
  296. "\0magic mapping",
  297. "\0hold monsters",
  298. "\0gem perfection",
  299. "\0spell extension",
  300. "\0identify",
  301. "\0remove curse",
  302. "\0annihilation",
  303. "\0pulverization",
  304. "\0life protection",
  305. "\0 ",
  306. "\0 ",
  307. "\0 ",
  308. "\0 ",
  309. "\0zzzzzzzzzzzzzz"    /* sentinel, for the sorted known objects inventory */
  310.  };
  311.  
  312. /*  name array for magic potions    */
  313. char *potionname[MAXPOTION+1] = {
  314. "\0sleep",
  315. "\0healing",
  316. "\0raise level",
  317. "\0increase ability",
  318. "\0wisdom",
  319. "\0strength",
  320. "\0raise charisma",
  321. "\0dizziness",
  322. "\0learning",
  323. "\0object detection",
  324. "\0monster detection",
  325. "\0forgetfulness",
  326. "\0water",
  327. "\0blindness",
  328. "\0confusion",
  329. "\0heroism",
  330. "\0sturdiness",
  331. "\0giant strength",
  332. "\0fire resistance",
  333. "\0treasure finding",
  334. "\0instant healing",
  335. " cure dianthroritis",
  336. "\0poison",
  337. "\0see invisible",
  338. "\0 ",
  339. "\0 ",
  340. "\0 ",
  341. "\0 ",
  342. "\0 ",
  343. "\0 ",
  344. "\0 ",
  345. "\0 ",
  346. "\0 ",
  347. "\0 ",
  348. "\0 ",
  349. "\0zzzzzzzzzzzzzz"    /* sentinel, for the sorted known objects inventory */
  350.  };
  351.  
  352.  
  353. /*
  354.     spell data
  355.  */
  356. char spelknow[SPNUM];
  357. char splev[] = { 1, 4, 9, 14, 18, 22, 26, 29, 32, 35, 37, 37, 37, 37, 37 };
  358.  
  359. char *spelcode[SPNUM+1]={
  360.     "pro",  "mle",  "dex",  "sle",  "chm",  "ssp",
  361.     "web",  "str",  "enl",  "hel",  "cbl",  "cre",  "pha",  "inv",
  362.     "bal",  "cld",  "ply",  "can",  "has",  "ckl",  "vpr",
  363.     "dry",  "lit",  "drl",  "glo",  "flo",  "fgr",
  364.     "sca",  "hld",  "stp",  "tel",  "mfi", /* 31 */
  365.     "sph",  "gen",  "sum",  "wtw",  "alt",  "per", "zzz"
  366.  };
  367.  
  368. char *spelname[]={
  369.     "protection",               "magic missile",        "dexterity",
  370.     "sleep",                    "charm monster",        "sonic spear",
  371.  
  372.     "web",                      "strength",             "enlightenment",
  373.     "healing",                  "cure blindness",       "create monster",
  374.     "phantasmal forces",        "invisibility",
  375.  
  376.     "fireball",                 "cold",                 "polymorph",
  377.     "cancellation",             "haste self",           "cloud kill",
  378.     "vaporize rock",
  379.  
  380.     "dehydration",              "lightning",            "drain life",
  381.     "invulnerability",          "flood",                "finger of death",
  382.  
  383.     "scare monster",            "hold monster",         "time stop",
  384.     "teleport away",            "magic fire",
  385.  
  386.     "sphere of annihilation",   "genocide",             "summon demon",
  387.     "walk through walls",       "alter reality",        "permanence",
  388.     ""
  389.  };
  390.  
  391. char *speldescript[]={
  392. /* 1 */
  393.     "generates a +2 protection field",
  394.     "creates and hurls a magic missile equivalent to a + 1 magic arrow",
  395.     "adds +2 to the casters dexterity",
  396.     "causes some monsters to go to sleep",
  397.     "some monsters may be awed at your magnificence",
  398.     "causes your hands to emit a screeching sound toward what they point",
  399. /* 7 */
  400.     "causes strands of sticky thread to entangle an enemy",
  401.     "adds +2 to the casters strength for a short term",
  402.     "the caster becomes aware of things around him",
  403.     "restores some hp to the caster",
  404.     "restores sight to one so unfortunate as to be blinded",
  405.     "creates a monster near the caster appropriate for the location",
  406.     "creates illusions, and if believed, monsters die",
  407.     "the caster becomes invisible",
  408. /* 15 */
  409.     "makes a ball of fire that burns on what it hits",
  410.     "sends forth a cone of cold which freezes what it touches",
  411.     "you can find out what this does for yourself",
  412.     "negates the ability of a monster to use his special abilities",
  413.     "speeds up the casters movements",
  414.     "creates a fog of poisonous gas which kills all that is within it",
  415.     "this changes rock to air",
  416. /* 22 */
  417.     "dries up water in the immediate vicinity",
  418.     "you finger will emit a lightning bolt when this spell is cast",
  419.     "subtracts hit points from both you and a monster",
  420.     "this globe helps to protect the player from physical attack",
  421.     "this creates an avalanche of H2O to flood the immediate chamber",
  422.     "this is a holy spell and calls upon your god to back you up",
  423. /* 28 */
  424.     "terrifies the monster so that hopefully he wont hit the magic user",
  425.     "the monster is frozen in his tracks if this is successful",
  426.     "all movement in the caverns ceases for a limited duration",
  427.     "moves a particular monster around in the dungeon (hopefully away from you)",
  428.     "this causes a curtain of fire to appear all around you",
  429. /* 33 */
  430.     "anything caught in this sphere is instantly killed.  Warning -- dangerous",
  431.     "eliminates a species of monster from the game -- use sparingly",
  432.     "summons a demon who hopefully helps you out",
  433.     "allows the player to walk through walls for a short period of time",
  434.     "god only knows what this will do",
  435.     "makes a character spell permanent, i. e. protection, strength, etc.",
  436.     ""
  437.  };
  438.  
  439. char spelweird[MAXMONST+8][SPNUM] = {
  440. /*                      p m d s c s    w s e h c c p i    b c p c h c v    d l d g f f    s h s t m    s g s w a p */
  441. /*                      r l e l h s    e t n e b r h n    a l l a a k p    r i r l l g    c l t e f    p e u t l e */
  442. /*                      o e x e m p    b r l l l e a v    l d y n s l r    y t l o o r    a d p l i    h n m w t r */
  443.     
  444.  
  445. /*            bat */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  446. /*          gnome */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  447. /*      hobgoblin */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  448. /*         jackal */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  449. /*         kobold */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  450.  
  451. /*            orc */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  452. /*          snake */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  453. /*giant centipede */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  454. /*         jaculi */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  455. /*     troglodyte */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  456.  
  457. /*      giant ant */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  458. /*   floating eye */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  459. /*     leprechaun */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  460. /*          nymph */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  461. /*         quasit */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  462.  
  463. /*   rust monster */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  464. /*         zombie */ {  0,0,0,8,0,4,   0,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   4,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  465. /*   assassin bug */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  466. /*        bugbear */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  467. /*     hell hound */ {  0,6,0,0,0,0,   12,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  468.  
  469. /*     ice lizard */ {  0,0,0,0,0,0,   11,0,0,0,0,0,0,0,  0,15,0,0,0,0,0,  0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  470. /*        centaur */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  471. /*          troll */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  472. /*           yeti */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,15,0,0,0,0,0,  0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  473. /*   white dragon */ {  0,0,0,0,0,0,   0,0,0,0,0,0,14,0,  0,15,0,0,0,0,0,  4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  474.  
  475. /*            elf */ {  0,0,0,0,0,0,   0,0,0,0,0,0,14,5,  0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  476. /*gelatinous cube */ {  0,0,0,0,0,0,   2,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   0,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  477. /*      metamorph */ {  0,13,0,0,0,0,  2,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   4,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  478. /*         vortex */ {  0,13,0,0,0,10, 1,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  479. /*         ziller */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  480.  
  481. /*   violet fungi */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  482. /*         wraith */ {  0,0,0,8,0,4,   0,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   4,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  483. /*      forvalaka */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  484. /*      lama nobe */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  485. /*        osequip */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  486.  
  487. /*          rothe */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  488. /*           xorn */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   4,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  489. /*        vampire */ {  0,0,0,8,0,4,   0,0,0,0,0,0,0,0,   0,0,0,0,0,4,0,   0,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  490. /*invisible staker*/ {  0,0,0,0,0,0,   1,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  491. /*    poltergeist */ {  0,13,0,8,0,4,  1,0,0,0,0,0,0,0,   0,4,0,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  492.  
  493. /* disenchantress */ {  0,0,0,8,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  494. /*shambling mound */ {  0,0,0,0,0,10,  0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  495. /*    yellow mold */ {  0,0,0,8,0,0,   1,0,0,0,0,0,4,0,   0,0,0,0,0,4,0,   0,0,0,0,0,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  496. /*     umber hulk */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,5,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  497. /*     gnome king */ {  0,7,0,0,3,0,   0,0,0,0,0,0,0,5,   0,0,9,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  498.  
  499. /*          mimic */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  500. /*     water lord */ {  0,13,0,8,3,4,  1,0,0,0,0,0,0,0,   0,0,9,0,0,4,0,   0,0,0,0,16,4,  0,0,0,0,0,   0,0,0,0,0,0 },
  501. /*  bronze dragon */ {  0,7,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  502. /*   green dragon */ {  0,7,0,0,0,0,   11,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  503. /*    purple worm */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  504.  
  505. /*          xvart */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  506. /*    spirit naga */ {  0,13,0,8,3,4,  1,0,0,0,0,0,0,5,   0,4,9,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   0,0,0,0,0,0 },
  507. /*  silver dragon */ {  0,6,0,9,0,0,   12,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  508. /*platinum dragon */ {  0,7,0,9,0,0,   11,0,0,0,0,0,14,0, 0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  509. /*   green urchin */ {  0,0,0,0,0,0,   0,0,0,0,0,0,0,0,   0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  510. /*     red dragon */ {  0,6,0,0,0,0,   12,0,0,0,0,0,0,0,  0,0,0,0,0,0,0,   0,0,0,0,0,0,   0,0,0,0,0,   0,0,0,0,0,0 },
  511.  
  512. /*                      p m d s c s    w s e h c c p i    b c p c h c v    d l d g f f    s h s t m    s g s w a p */
  513. /*                      r l e l h s    e t n e b r h n    a l l a a k p    r i r l l g    c l t e f    p e u t l e */
  514. /*                      o e x e m p    b r l l l e a v    l d y n s l r    y t l o o r    a d p l i    h n m w t r */
  515.  
  516. /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
  517. /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
  518. /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
  519. /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
  520. /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
  521. /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
  522. /*     demon lord */ {  0,7,0,4,3,0,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   0,0,0,0,0,   9,0,0,0,0,0 },
  523. /*   demon prince */ {  0,7,0,4,3,9,   1,0,0,0,0,0,14,5,  0,0,4,0,0,4,0,   4,0,0,0,4,4,   4,0,0,0,4,   9,0,0,0,0,0 }
  524.  
  525.  };
  526.  
  527. char *spelmes[] = { "",
  528. /*  1 */    "the web had no effect on the %s",
  529. /*  2 */    "the %s changed shape to avoid the web",
  530. /*  3 */    "the %s isn't afraid of you",
  531. /*  4 */    "the %s isn't affected",
  532. /*  5 */    "the %s can see you with his infravision",
  533. /*  6 */    "the %s vaporizes your missile",
  534. /*  7 */    "your missile bounces off the %s",
  535. /*  8 */    "the %s doesn't sleep",
  536. /*  9 */    "the %s resists",
  537. /* 10 */    "the %s can't hear the noise",
  538. /* 11 */    "the %s's tail cuts it free of the web",
  539. /* 12 */    "the %s burns through the web",
  540. /* 13 */    "your missiles pass right through the %s",
  541. /* 14 */    "the %s sees through your illusions",
  542. /* 15 */    "the %s loves the cold!",
  543. /* 16 */    "the %s loves the water!"
  544.  };
  545.  
  546. /*
  547.  *  function to create scroll numbers with appropriate probability of 
  548.  *  occurrence
  549.  *
  550.  *  0 - armor           1 - weapon      2 - enlightenment   3 - paper
  551.  *  4 - create monster  5 - create item 6 - aggravate       7 - time warp
  552.  *  8 - teleportation   9 - expanded awareness              10 - haste monst
  553.  *  11 - heal monster   12 - spirit protection      13 - undead protection
  554.  *  14 - stealth        15 - magic mapping          16 - hold monster
  555.  *  17 - gem perfection 18 - spell extension        19 - identify
  556.  *  20 - remove curse   21 - annihilation           22 - pulverization
  557.  *  23 - life protection
  558.  */
  559. char scprob[]= { 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3,
  560.     3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9,
  561.     9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 13, 14, 14,
  562.     15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 22,
  563.     22, 22, 23 };
  564.  
  565. /*
  566.  *  function to return a potion number created with appropriate probability
  567.  *  of occurrence
  568.  *
  569.  *  0 - sleep               1 - healing                 2 - raise level
  570.  *  3 - increase ability    4 - gain wisdom             5 - gain strength
  571.  *  6 - increase charisma   7 - dizziness               8 - learning
  572.  *  9 - object detection    10 - monster detection      11 - forgetfulness
  573.  *  12 - water              13 - blindness              14 - confusion
  574.  *  15 - heroism            16 - sturdiness             17 - giant strength
  575.  *  18 - fire resistance    19 - treasure finding       20 - instant healing
  576.  *  21 - cure dianthroritis 22 - poison                 23 - see invisible
  577.  */
  578. char potprob[] = { 0, 0, 1, 1, 1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 9, 9, 9,
  579.                10, 10, 10, 11, 11, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 19,
  580.                20, 20, 22, 22, 23, 23 };
  581.  
  582. char nlpts[] = { 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7 };
  583. char nch[] = { 0, 0, 0, 1, 1, 1, 2, 2, 3, 4 };
  584. char nplt[] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 4 };
  585. char ndgg[] = { 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 4, 5 };
  586. char nsw[] = { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 3 };
  587.